<template>
  <el-table :data="tableData" stripe style="width: 100%; height: 300px" border v-loading="loading" element-loading-text="查询中...">
    <el-table-column v-for="col in tableConfig" :key="col.label" :type="col.type" :label="col.label" :prop="col.prop" :align="col.align">
      <template v-slot="scope" v-if="col.type === null">
        <slot :name="col.name" v-if="col.slot" :row="scope.row" :index="scope.$index"></slot>
        <span v-else>{{ scope.row[col.prop] || '-' }}</span>
      </template>
    </el-table-column>
  </el-table>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
  name: 'mytable',
  props: {
    tableData: {
      default(data: any) {
        return data
      },
    },
    tableConfig: {
      default(data: any) {
        return data
      },
    },
    loading: {
      default(data: any) {
        return data
      },
    },
  },

  setup() {
    return {}
  },
  components: {},
})
</script>
